package com.thoughtworks.biblioteca.util;

import java.io.InputStreamReader;
import java.io.BufferedReader;

public class ConsoleUtil {
    private static InputStreamReader inputStream = new InputStreamReader(System.in);
    private static BufferedReader reader = new BufferedReader(inputStream);

    public int getNumberFromConsole() {
        int number = 0;
        try {
            number = Integer.parseInt(reader.readLine());
        } catch (Exception e) {
            System.out.println("Enter a valid integer!!");
        }
        return number;
    }

}
